package com.yyy.dm.item;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "dm")
public class ListItemDTO implements Serializable {

    @Field(type = FieldType.Integer,name = "id")
    private Long id;
    @Field(type = FieldType.Keyword,name = "areaname")
    private String areaName;
    @Field(type = FieldType.Text,analyzer = "ik_smart",name="itemname")
    private String itemName;
    @Field(type = FieldType.Text,analyzer = "ik_smart",name = "abstractmessage")
    private String abstractMessage;
    @Field(type = FieldType.Date,format = DateFormat.date_optional_time,name = "starttime")
    private LocalDateTime startTime;
    @Field(type = FieldType.Date,format = DateFormat.date_optional_time,name = "endtime")
    private LocalDateTime endTime;
    @Field(type = FieldType.Keyword,name = "address")
    private String address;
    @Field(type = FieldType.Double,name = "latitude")
    private Double latitude;
    @Field(type = FieldType.Double,name = "longitude")
    private Double longitude;
    @Field(type = FieldType.Double,name = "minprice")
    private Double minPrice;
    @Field(type = FieldType.Double,name = "maxprice")
    private Double maxPrice;
    @Field(type = FieldType.Keyword,name = "imgurl")
    private String imgUrl;
    @Field(type = FieldType.Integer,name = "areaid")
    private Long areaId;
    @Field(type = FieldType.Integer,name = "itemtype1id")
    private Long itemType1Id;
    @Field(type = FieldType.Integer,name = "itemtype2id")
    private Long itemType2Id;
}
